﻿namespace QLBanHang.UC
{
    using DevExpress.Data;
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Mask;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Base;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTab;
    using Access;
    using Access.Duoc;
    using BaseClass.Duoc;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;

    public class ucd_capnhatgiaban : XtraUserControl
    {
        private long _idnhapkho;
        private int _iiddangnhap;
        private DNhapKho _nhapkho;
        private General _xuli;
        private SimpleButton btnboqua;
        private SimpleButton btnin;
        private SimpleButton btnketthuc;
        private SimpleButton btnluu;
        private SimpleButton btnsua;
        private IContainer components;
        private DateEdit dtpngayapgia;
        private GridControl gridds;
        private GridColumn gridds_dvt;
        private GridColumn gridds_giabanlecu;
        private GridColumn gridds_giabanlemoi;
        private GridColumn gridds_giabansicu;
        private GridColumn gridds_giabansimoi;
        private GridColumn gridds_id;
        private GridColumn gridds_ma;
        private GridColumn gridds_mavach;
        private GridColumn gridds_ngayapgia;
        private GridColumn gridds_ten;
        private GridColumn gridds_tennhasx;
        private GridView gridView1;
        private Label label1;
        private Label label15;
        private Label label16;
        private Label label2;
        private Label label25;
        private Label label4;
        private Label label5;
        private Label label8;
        private Label lblmaso;
        private RepositoryItemTextEdit repositoryItemTextEdit1;
        private RepositoryItemTextEdit repositoryItemTextEdit2;
        private TextEdit txtgiale;
        private TextEdit txtgialecu;
        private TextEdit txtgiasi;
        private TextEdit txtgiasicu;
        private TextEdit txthangsx;
        private TextEdit txtma;
        private TextEdit txtmavach;
        private TextEdit txtten;

        public ucd_capnhatgiaban()
        {
            this._idnhapkho = 0L;
            this._iiddangnhap = 0;
            this.components = null;
            this.InitializeComponent();
            this._xuli = new General();
        }

        public ucd_capnhatgiaban(int iddangnhap)
        {
            this._idnhapkho = 0L;
            this._iiddangnhap = 0;
            this.components = null;
            this.InitializeComponent();
            this._xuli = new General();
            this._iiddangnhap = iddangnhap;
        }

        public ucd_capnhatgiaban(General xuli, int iddangnhap)
        {
            this._idnhapkho = 0L;
            this._iiddangnhap = 0;
            this.components = null;
            this.InitializeComponent();
            this._xuli = xuli;
            this._iiddangnhap = iddangnhap;
        }

        public ucd_capnhatgiaban(General xuli, long idnhapkho, int iddangnhap)
        {
            this._idnhapkho = 0L;
            this._iiddangnhap = 0;
            this.components = null;
            this.InitializeComponent();
            this._xuli = xuli;
            this._idnhapkho = idnhapkho;
            this._iiddangnhap = iddangnhap;
        }

        private void btnboqua_Click(object sender, EventArgs e)
        {
            this.f_Control_enable(false);
        }

        private void btnhuy_Click(object sender, EventArgs e)
        {
            try
            {
            }
            catch
            {
            }
        }

        private void btnin_Click(object sender, EventArgs e)
        {
        }

        private void btnketthuc_Click(object sender, EventArgs e)
        {
            try
            {
                XtraTabPage parent = (XtraTabPage) base.Parent;
                XtraTabControl control = (XtraTabControl) parent.Parent;
                control.TabPages.Remove(parent);
            }
            catch
            {
                XtraUserControl control2 = (XtraUserControl) base.Parent;
                control2.Controls.Remove(this);
            }
        }

        private void btnluu_Click(object sender, EventArgs e)
        {
            if (this.f_kiemtra_thongtinphieu())
            {
                dtoDCapNhatGiaBan ban = new dtoDCapNhatGiaBan(this._xuli.pConFigData) {
                    pIDSANPHAM = Convert.ToInt32(this.lblmaso.Tag.ToString()),
                    pIDDANGNHAP = this._iiddangnhap,
                    pGIABANLE_CU = Convert.ToInt32(this.txtgialecu.EditValue),
                    pGIABANLE_MOI = Convert.ToInt32(this.txtgiale.EditValue),
                    pGIABANSI_CU = Convert.ToInt32(this.txtgiasicu.EditValue),
                    pGIABANSI_MOI = Convert.ToInt32(this.txtgiasi.EditValue),
                    pNGAYAPGIA = this.dtpngayapgia.Text,
                    pTENMAYTINH = Environment.MachineName
                };
                if (!ban.Update() && !ban.Insert())
                {
                    MessageBox.Show("Kh\x00f4ng lưu được th\x00f4ng tin theo d\x00f5i gi\x00e1 b\x00e1n.", "Th\x00f4ng b\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
                else
                {
                    this.f_load_theodoigia();
                    this.btntim_Click(null, null);
                    this.f_Control_enable(false);
                    this.gridView1.Focus();
                }
            }
        }

        private void btnmoi_Click_1(object sender, EventArgs e)
        {
            this.f_Control_enable(true);
            this.dtpngayapgia.EditValue = DateTime.Now;
            this.f_Loadcontrol_nhapkho(DateTime.Now.ToString("dd/MM/yyyy HH:mm"), 0);
            this.f_loaddata_nhapkhoct(0L);
            this.f_loadinfo_chitiet(0);
            base.ActiveControl = this.dtpngayapgia;
        }

        private void btnsua_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable dataSource = (DataTable) this.gridds.DataSource;
                this.f_Control_enable(true);
                this.txtgiale.Focus();
            }
            catch
            {
            }
        }

        private void btnthemduocpham_Click(object sender, EventArgs e)
        {
            ucd_dmduocpham _dmduocpham = new ucd_dmduocpham();
            base.Controls.Add(_dmduocpham);
            _dmduocpham.Location = new Point(0, 0);
            _dmduocpham.Width = base.Width;
            _dmduocpham.Height = base.Height;
            _dmduocpham.Show();
            _dmduocpham.BringToFront();
        }

        private void btnthemquydoi_Click(object sender, EventArgs e)
        {
            dtoDDMDuocPham dtodp = new dtoDDMDuocPham {
                pID = Convert.ToInt32(this.txtma.Tag.ToString())
            };
            dtodp.Load();
            ucd_dmquydoi _dmquydoi = new ucd_dmquydoi(this._xuli.pConFigData, dtodp);
            base.Controls.Add(_dmquydoi);
            _dmquydoi.Location = new Point(0, 0);
            _dmquydoi.Width = base.Width;
            _dmquydoi.Height = base.Height;
            _dmquydoi.Show();
            _dmquydoi.BringToFront();
            _dmquydoi.Focus();
        }

        private void btntim_Click(object sender, EventArgs e)
        {
            try
            {
            }
            catch
            {
            }
        }

        private void btnxoa_Click(object sender, EventArgs e)
        {
            if (this.txtma.Tag.ToString() != "0")
            {
                try
                {
                    this.gridView1.DeleteSelectedRows();
                    this.f_loadinfo_chitiet(0);
                }
                catch
                {
                }
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void f_Control_enable(bool chophep)
        {
            this.btnluu.Enabled = this.btnboqua.Enabled = chophep;
            this.btnsua.Enabled = this.btnketthuc.Enabled = !chophep;
        }

        private bool f_kiemtra_thongtinphieu()
        {
            return true;
        }

        private void f_load_dmkho()
        {
            try
            {
            }
            catch
            {
            }
        }

        private void f_load_theodoigia()
        {
            try
            {
                this.gridds.DataSource = new DTheoDoiGiaBan(this._xuli.pConFigData).f_loaddata_theodoigia();
            }
            catch
            {
            }
        }

        private void f_Loadcontrol_dmvp(long id, string ma, string ten, string tenhoatchat, string dvt)
        {
            this.txtma.Text = ma;
            this.txtma.Tag = id.ToString();
            this.txtten.Text = ten;
            this.txtmavach.Text = tenhoatchat;
            try
            {
            }
            catch
            {
            }
            try
            {
                dtoDDMDuocPham pham = new dtoDDMDuocPham(this._xuli.pConFigData) {
                    pID = Convert.ToInt32(id)
                };
                pham.Load();
                dtoDDMNhaSanXuat xuat = new dtoDDMNhaSanXuat(this._xuli.pConFigData) {
                    pID = pham.pIDNHASX
                };
                xuat.Load();
                this.txthangsx.Text = xuat.pTEN;
            }
            catch
            {
                this.txthangsx.Text = "";
            }
        }

        private void f_Loadcontrol_nhapkho(string ngay, int idkho)
        {
            try
            {
                this.dtpngayapgia.EditValue = new DateTime(int.Parse(ngay.Substring(6, 4)), int.Parse(ngay.Substring(3, 2)), int.Parse(ngay.Substring(0, 2)), int.Parse(ngay.Substring(11, 2)), int.Parse(ngay.Substring(14, 2)), 0);
            }
            catch
            {
            }
        }

        private void f_Loadcontrol_nhapkhochitiet(int idsp, string ma, string mavach, string ten, string nhasx, int gialecu, int gialemoi, int giasicu, int giasimoi, string ngayapgia)
        {
            this.lblmaso.Tag = idsp.ToString();
            this.txtmavach.Text = mavach;
            this.txtma.Text = ma;
            this.txtten.Text = ten;
            this.txthangsx.Text = nhasx;
            this.txtgiale.EditValue = gialemoi;
            this.txtgialecu.EditValue = gialecu;
            this.txtgiasi.EditValue = giasimoi;
            this.txtgiasicu.EditValue = giasimoi;
            try
            {
                this.dtpngayapgia.EditValue = new DateTime(int.Parse(ngayapgia.Substring(6, 4)), int.Parse(ngayapgia.Substring(3, 2)), int.Parse(ngayapgia.Substring(0, 2)), int.Parse(ngayapgia.Substring(11, 2)), int.Parse(ngayapgia.Substring(14, 2)), 0);
            }
            catch
            {
            }
        }

        private void f_loaddata_nhapkhoct(long idtoathuoc)
        {
            DataTable table = this._nhapkho.f_loaddata_nhapkhoct(idtoathuoc);
            this.gridds.DataSource = table;
        }

        private void f_loadinfo_chitiet(int indexrow)
        {
            try
            {
                this.f_Loadcontrol_nhapkhochitiet(int.Parse(this.gridView1.GetRowCellValue(indexrow, this.gridds_id).ToString()), this.gridView1.GetRowCellValue(indexrow, this.gridds_ma).ToString(), this.gridView1.GetRowCellValue(indexrow, this.gridds_mavach).ToString(), this.gridView1.GetRowCellValue(indexrow, this.gridds_ten).ToString(), this.gridView1.GetRowCellValue(indexrow, this.gridds_tennhasx).ToString(), int.Parse(this.gridView1.GetRowCellValue(indexrow, this.gridds_giabanlecu).ToString()), int.Parse(this.gridView1.GetRowCellValue(indexrow, this.gridds_giabanlemoi).ToString()), int.Parse(this.gridView1.GetRowCellValue(indexrow, this.gridds_giabansicu).ToString()), int.Parse(this.gridView1.GetRowCellValue(indexrow, this.gridds_giabansimoi).ToString()), this.gridView1.GetRowCellValue(indexrow, this.gridds_ngayapgia).ToString());
            }
            catch
            {
                this.f_Loadcontrol_nhapkhochitiet(0, "", "", "", "", 0, 0, 0, 0, DateTime.Now.ToString("dd/MM/yyyy HH:mm"));
            }
        }

        private void f_SetControl_dmsanpham(long idvp)
        {
        }

        private void f_setcontrol_nhapkho(long id)
        {
            new dtoDNhapKho(this._xuli.pConFigData) { pID = id }.Load();
            try
            {
            }
            catch
            {
                this.f_Loadcontrol_nhapkho(DateTime.Now.ToString("dd/MM/yyyy HH:mm"), 0);
            }
        }

        private void gridView1_CustomSummaryCalculate(object sender, CustomSummaryEventArgs e)
        {
        }

        private void gridView1_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
        {
            int indexrow = 0;
            try
            {
                if (this.gridView1.IsFocusedView && !this.btnluu.Enabled)
                {
                    indexrow = this.gridView1.GetSelectedRows()[0];
                    this.f_loadinfo_chitiet(indexrow);
                }
            }
            catch
            {
            }
        }

        private void gridView1_RowCellStyle(object sender, RowCellStyleEventArgs e)
        {
            try
            {
            }
            catch
            {
            }
        }

        private void gridView2_FocusedColumnChanged(object sender, FocusedColumnChangedEventArgs e)
        {
            this.gridView2_FocusedRowChanged(null, (FocusedRowChangedEventArgs) null);
        }

        private void gridView2_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
        {
        }

        private void gridView2_FocusedRowChanged(object sender, EventArgs e)
        {
            this.gridView2_FocusedRowChanged(null, (FocusedRowChangedEventArgs) null);
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(ucd_capnhatgiaban));
            StyleFormatCondition condition = new StyleFormatCondition();
            this.gridds_giabansicu = new GridColumn();
            this.repositoryItemTextEdit2 = new RepositoryItemTextEdit();
            this.lblmaso = new Label();
            this.txtma = new TextEdit();
            this.txtten = new TextEdit();
            this.btnluu = new SimpleButton();
            this.btnsua = new SimpleButton();
            this.btnketthuc = new SimpleButton();
            this.gridView1 = new GridView();
            this.gridds_mavach = new GridColumn();
            this.gridds_ma = new GridColumn();
            this.repositoryItemTextEdit1 = new RepositoryItemTextEdit();
            this.gridds_ten = new GridColumn();
            this.gridds_dvt = new GridColumn();
            this.gridds_id = new GridColumn();
            this.gridds_giabanlecu = new GridColumn();
            this.gridds_giabansimoi = new GridColumn();
            this.gridds_giabanlemoi = new GridColumn();
            this.gridds_ngayapgia = new GridColumn();
            this.gridds_tennhasx = new GridColumn();
            this.gridds = new GridControl();
            this.btnboqua = new SimpleButton();
            this.txtmavach = new TextEdit();
            this.label2 = new Label();
            this.label15 = new Label();
            this.label16 = new Label();
            this.txthangsx = new TextEdit();
            this.label8 = new Label();
            this.dtpngayapgia = new DateEdit();
            this.label25 = new Label();
            this.txtgiale = new TextEdit();
            this.txtgiasi = new TextEdit();
            this.btnin = new SimpleButton();
            this.label1 = new Label();
            this.label4 = new Label();
            this.label5 = new Label();
            this.txtgialecu = new TextEdit();
            this.txtgiasicu = new TextEdit();
            this.repositoryItemTextEdit2.BeginInit();
            this.txtma.Properties.BeginInit();
            this.txtten.Properties.BeginInit();
            this.gridView1.BeginInit();
            this.repositoryItemTextEdit1.BeginInit();
            this.gridds.BeginInit();
            this.txtmavach.Properties.BeginInit();
            this.txthangsx.Properties.BeginInit();
            this.dtpngayapgia.Properties.VistaTimeProperties.BeginInit();
            this.dtpngayapgia.Properties.BeginInit();
            this.txtgiale.Properties.BeginInit();
            this.txtgiasi.Properties.BeginInit();
            this.txtgialecu.Properties.BeginInit();
            this.txtgiasicu.Properties.BeginInit();
            base.SuspendLayout();
            this.gridds_giabansicu.Caption = "Gi\x00e1 b\x00e1n sỉ cũ";
            this.gridds_giabansicu.ColumnEdit = this.repositoryItemTextEdit2;
            this.gridds_giabansicu.FieldName = "giabansicu";
            this.gridds_giabansicu.Name = "gridds_giabansicu";
            this.gridds_giabansicu.OptionsColumn.AllowEdit = false;
            this.gridds_giabansicu.Visible = true;
            this.gridds_giabansicu.VisibleIndex = 4;
            this.gridds_giabansicu.Width = 0x47;
            this.repositoryItemTextEdit2.AutoHeight = false;
            this.repositoryItemTextEdit2.DisplayFormat.FormatString = "n0";
            this.repositoryItemTextEdit2.DisplayFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit2.EditFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit2.Mask.EditMask = "n0";
            this.repositoryItemTextEdit2.Mask.MaskType = MaskType.Numeric;
            this.repositoryItemTextEdit2.Name = "repositoryItemTextEdit2";
            this.lblmaso.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.lblmaso.Font = new Font("Tahoma", 10f);
            this.lblmaso.Location = new Point(0xc2, 0x193);
            this.lblmaso.Name = "lblmaso";
            this.lblmaso.Size = new Size(0x60, 0x13);
            this.lblmaso.TabIndex = 2;
            this.lblmaso.Text = "Sản phẩm:";
            this.lblmaso.TextAlign = ContentAlignment.TopRight;
            this.txtma.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.txtma.Location = new Point(0x120, 0x192);
            this.txtma.Name = "txtma";
            this.txtma.Properties.CharacterCasing = CharacterCasing.Upper;
            this.txtma.Properties.ReadOnly = true;
            this.txtma.Size = new Size(0x48, 20);
            this.txtma.TabIndex = 1;
            this.txtma.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.txtma.Validated += new EventHandler(this.txtma_Validated);
            this.txtten.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.txtten.Location = new Point(360, 0x192);
            this.txtten.Name = "txtten";
            this.txtten.Properties.ReadOnly = true;
            this.txtten.Size = new Size(0xdf, 20);
            this.txtten.TabIndex = 2;
            this.txtten.TextChanged += new EventHandler(this.txtten_TextChanged);
            this.txtten.Enter += new EventHandler(this.txtten_Enter);
            this.txtten.KeyDown += new KeyEventHandler(this.txtten_KeyDown);
            this.txtten.Validated += new EventHandler(this.txtten_Validated);
            this.btnluu.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.btnluu.Appearance.Options.UseTextOptions = true;
            this.btnluu.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnluu.Image = Resources.Reso.imgsave;// (Image)manager.GetObject("btnluu.Image");
            this.btnluu.Location = new Point(1, 0x1d2);
            this.btnluu.Name = "btnluu";
            this.btnluu.Size = new Size(0x4b, 0x17);
            this.btnluu.TabIndex = 11;
            this.btnluu.Text = " &Lưu [F5]";
            this.btnluu.Click += new EventHandler(this.btnluu_Click);
            this.btnsua.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.btnsua.Appearance.Options.UseTextOptions = true;
            this.btnsua.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnsua.Image = Resources.Reso.imgedit;// (Image)manager.GetObject("btnsua.Image");
            this.btnsua.Location = new Point(0x4f, 0x1d2);
            this.btnsua.Name = "btnsua";
            this.btnsua.Size = new Size(0x4b, 0x17);
            this.btnsua.TabIndex = 12;
            this.btnsua.Text = " &Sửa [F3]";
            this.btnsua.Click += new EventHandler(this.btnsua_Click);
            this.btnketthuc.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btnketthuc.Appearance.Options.UseTextOptions = true;
            this.btnketthuc.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnketthuc.Image = Resources.Reso.imgclose;// (Image)manager.GetObject("btnketthuc.Image");
            this.btnketthuc.Location = new Point(0x3d0, 0x1d3);
            this.btnketthuc.Name = "btnketthuc";
            this.btnketthuc.Size = new Size(0x65, 0x17);
            this.btnketthuc.TabIndex = 0x11;
            this.btnketthuc.Text = " &Kết th\x00fac [F12]";
            this.btnketthuc.Click += new EventHandler(this.btnketthuc_Click);
            this.gridView1.Appearance.ColumnFilterButton.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.ColumnFilterButton.BorderColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.ColumnFilterButton.ForeColor = Color.Black;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseBackColor = true;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseForeColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.BackColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView1.Appearance.ColumnFilterButtonActive.BorderColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView1.Appearance.ColumnFilterButtonActive.ForeColor = Color.Black;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBackColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBorderColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseForeColor = true;
            this.gridView1.Appearance.Empty.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.Empty.BackColor2 = Color.White;
            this.gridView1.Appearance.Empty.Options.UseBackColor = true;
            this.gridView1.Appearance.EvenRow.BackColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView1.Appearance.EvenRow.BorderColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView1.Appearance.EvenRow.ForeColor = Color.Black;
            this.gridView1.Appearance.EvenRow.Options.UseBackColor = true;
            this.gridView1.Appearance.EvenRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.EvenRow.Options.UseForeColor = true;
            this.gridView1.Appearance.FilterCloseButton.BackColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView1.Appearance.FilterCloseButton.BorderColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView1.Appearance.FilterCloseButton.ForeColor = Color.Black;
            this.gridView1.Appearance.FilterCloseButton.Options.UseBackColor = true;
            this.gridView1.Appearance.FilterCloseButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.FilterCloseButton.Options.UseForeColor = true;
            this.gridView1.Appearance.FilterPanel.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.FilterPanel.BackColor2 = Color.White;
            this.gridView1.Appearance.FilterPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.FilterPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.FilterPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.FixedLine.BackColor = Color.FromArgb(0x7a, 0x72, 0x71);
            this.gridView1.Appearance.FixedLine.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedCell.BackColor = Color.White;
            this.gridView1.Appearance.FocusedCell.ForeColor = Color.Black;
            this.gridView1.Appearance.FocusedCell.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedCell.Options.UseForeColor = true;
            this.gridView1.Appearance.FocusedRow.BackColor = Color.FromArgb(200, 0xc0, 0x9d);
            this.gridView1.Appearance.FocusedRow.BorderColor = Color.FromArgb(0xe2, 0xdb, 0xbc);
            this.gridView1.Appearance.FocusedRow.ForeColor = Color.Black;
            this.gridView1.Appearance.FocusedRow.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.FocusedRow.Options.UseForeColor = true;
            this.gridView1.Appearance.FooterPanel.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.FooterPanel.BorderColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.FooterPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.FooterPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.FooterPanel.Options.UseBorderColor = true;
            this.gridView1.Appearance.FooterPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupButton.BackColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView1.Appearance.GroupButton.BorderColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView1.Appearance.GroupButton.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupFooter.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.GroupFooter.BorderColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.GroupFooter.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupFooter.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupFooter.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupFooter.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupPanel.BackColor = Color.FromArgb(0xf6, 0xf2, 0xd5);
            this.gridView1.Appearance.GroupPanel.BackColor2 = Color.White;
            this.gridView1.Appearance.GroupPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupRow.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.GroupRow.BorderColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.GroupRow.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupRow.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupRow.Options.UseForeColor = true;
            this.gridView1.Appearance.HeaderPanel.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.HeaderPanel.BorderColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.HeaderPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.HeaderPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.HeaderPanel.Options.UseBorderColor = true;
            this.gridView1.Appearance.HeaderPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.HideSelectionRow.BackColor = Color.FromArgb(0xed, 230, 0xcb);
            this.gridView1.Appearance.HideSelectionRow.BorderColor = Color.FromArgb(0xed, 230, 0xcb);
            this.gridView1.Appearance.HideSelectionRow.ForeColor = Color.Black;
            this.gridView1.Appearance.HideSelectionRow.Options.UseBackColor = true;
            this.gridView1.Appearance.HideSelectionRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.HideSelectionRow.Options.UseForeColor = true;
            this.gridView1.Appearance.HorzLine.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.HorzLine.Options.UseBackColor = true;
            this.gridView1.Appearance.OddRow.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.OddRow.BorderColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.OddRow.ForeColor = Color.Black;
            this.gridView1.Appearance.OddRow.Options.UseBackColor = true;
            this.gridView1.Appearance.OddRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.OddRow.Options.UseForeColor = true;
            this.gridView1.Appearance.Preview.BackColor = Color.FromArgb(0xfb, 0xfc, 0xf7);
            this.gridView1.Appearance.Preview.Font = new Font("Verdana", 7.5f);
            this.gridView1.Appearance.Preview.ForeColor = Color.FromArgb(0x94, 0x94, 0x94);
            this.gridView1.Appearance.Preview.Options.UseBackColor = true;
            this.gridView1.Appearance.Preview.Options.UseFont = true;
            this.gridView1.Appearance.Preview.Options.UseForeColor = true;
            this.gridView1.Appearance.Row.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.Row.ForeColor = Color.Black;
            this.gridView1.Appearance.Row.Options.UseBackColor = true;
            this.gridView1.Appearance.Row.Options.UseForeColor = true;
            this.gridView1.Appearance.RowSeparator.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.RowSeparator.BackColor2 = Color.White;
            this.gridView1.Appearance.RowSeparator.Options.UseBackColor = true;
            this.gridView1.Appearance.SelectedRow.BackColor = Color.FromArgb(0xdd, 0xd7, 0xbc);
            this.gridView1.Appearance.SelectedRow.BorderColor = Color.FromArgb(0xed, 230, 0xcb);
            this.gridView1.Appearance.SelectedRow.ForeColor = Color.Black;
            this.gridView1.Appearance.SelectedRow.Options.UseBackColor = true;
            this.gridView1.Appearance.SelectedRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.SelectedRow.Options.UseForeColor = true;
            this.gridView1.Appearance.TopNewRow.BackColor = Color.White;
            this.gridView1.Appearance.TopNewRow.Options.UseBackColor = true;
            this.gridView1.Appearance.VertLine.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.VertLine.Options.UseBackColor = true;
            this.gridView1.Columns.AddRange(new GridColumn[] { this.gridds_mavach, this.gridds_ma, this.gridds_ten, this.gridds_dvt, this.gridds_id, this.gridds_giabansicu, this.gridds_giabanlecu, this.gridds_giabansimoi, this.gridds_giabanlemoi, this.gridds_ngayapgia, this.gridds_tennhasx });
            condition.Appearance.ForeColor = Color.Red;
            condition.Appearance.Options.UseForeColor = true;
            condition.Column = this.gridds_giabansicu;
            condition.Condition = FormatConditionEnum.Between;
            condition.Value1 = "0";
            condition.Value2 = "0";
            this.gridView1.FormatConditions.AddRange(new StyleFormatCondition[] { condition });
            this.gridView1.GridControl = this.gridds;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsBehavior.AllowAddRows = DefaultBoolean.True;
            this.gridView1.OptionsBehavior.AllowDeleteRows = DefaultBoolean.False;
            this.gridView1.OptionsBehavior.ReadOnly = true;
            this.gridView1.OptionsView.AutoCalcPreviewLineCount = true;
            this.gridView1.OptionsView.EnableAppearanceEvenRow = true;
            this.gridView1.OptionsView.EnableAppearanceOddRow = true;
            this.gridView1.OptionsView.ShowAutoFilterRow = true;
            this.gridView1.OptionsView.ShowFooter = true;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.gridView1.RowCellStyle += new RowCellStyleEventHandler(this.gridView1_RowCellStyle);
            this.gridView1.CustomSummaryCalculate += new CustomSummaryEventHandler(this.gridView1_CustomSummaryCalculate);
            this.gridView1.FocusedRowChanged += new FocusedRowChangedEventHandler(this.gridView1_FocusedRowChanged);
            this.gridds_mavach.Caption = "M\x00e3 vạch";
            this.gridds_mavach.FieldName = "mavach";
            this.gridds_mavach.Name = "gridds_mavach";
            this.gridds_mavach.OptionsColumn.AllowEdit = false;
            this.gridds_mavach.Visible = true;
            this.gridds_mavach.VisibleIndex = 0;
            this.gridds_mavach.Width = 0x66;
            this.gridds_ma.Caption = "M\x00e3 số";
            this.gridds_ma.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_ma.FieldName = "masp";
            this.gridds_ma.Name = "gridds_ma";
            this.gridds_ma.OptionsColumn.AllowEdit = false;
            this.gridds_ma.Summary.AddRange(new GridSummaryItem[] { new GridColumnSummaryItem(SummaryItemType.Count, "ma", "Tổng={0:n0}") });
            this.gridds_ma.Visible = true;
            this.gridds_ma.VisibleIndex = 1;
            this.gridds_ma.Width = 0x51;
            this.repositoryItemTextEdit1.AutoHeight = false;
            this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
            this.repositoryItemTextEdit1.ReadOnly = true;
            this.gridds_ten.Caption = "T\x00ean sản phẩm";
            this.gridds_ten.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_ten.FieldName = "tensp";
            this.gridds_ten.Name = "gridds_ten";
            this.gridds_ten.OptionsColumn.AllowEdit = false;
            this.gridds_ten.Visible = true;
            this.gridds_ten.VisibleIndex = 2;
            this.gridds_ten.Width = 0x1a1;
            this.gridds_dvt.Caption = "ĐVT";
            this.gridds_dvt.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_dvt.FieldName = "dvt";
            this.gridds_dvt.Name = "gridds_dvt";
            this.gridds_dvt.OptionsColumn.AllowEdit = false;
            this.gridds_dvt.Visible = true;
            this.gridds_dvt.VisibleIndex = 3;
            this.gridds_dvt.Width = 0x42;
            this.gridds_id.Caption = "id";
            this.gridds_id.FieldName = "idsp";
            this.gridds_id.Name = "gridds_id";
            this.gridds_giabanlecu.Caption = "Gi\x00e1 b\x00e1n lẻ cũ";
            this.gridds_giabanlecu.ColumnEdit = this.repositoryItemTextEdit2;
            this.gridds_giabanlecu.FieldName = "giabanlecu";
            this.gridds_giabanlecu.Name = "gridds_giabanlecu";
            this.gridds_giabanlecu.OptionsColumn.AllowEdit = false;
            this.gridds_giabanlecu.Visible = true;
            this.gridds_giabanlecu.VisibleIndex = 5;
            this.gridds_giabansimoi.AppearanceCell.ForeColor = Color.Blue;
            this.gridds_giabansimoi.AppearanceCell.Options.UseForeColor = true;
            this.gridds_giabansimoi.AppearanceHeader.ForeColor = Color.Blue;
            this.gridds_giabansimoi.AppearanceHeader.Options.UseForeColor = true;
            this.gridds_giabansimoi.Caption = "Gi\x00e1 b\x00e1n sỉ mới";
            this.gridds_giabansimoi.ColumnEdit = this.repositoryItemTextEdit2;
            this.gridds_giabansimoi.FieldName = "giabansimoi";
            this.gridds_giabansimoi.Name = "gridds_giabansimoi";
            this.gridds_giabansimoi.OptionsColumn.AllowEdit = false;
            this.gridds_giabansimoi.Visible = true;
            this.gridds_giabansimoi.VisibleIndex = 7;
            this.gridds_giabanlemoi.AppearanceCell.ForeColor = Color.Blue;
            this.gridds_giabanlemoi.AppearanceCell.Options.UseForeColor = true;
            this.gridds_giabanlemoi.AppearanceHeader.ForeColor = Color.Blue;
            this.gridds_giabanlemoi.AppearanceHeader.Options.UseForeColor = true;
            this.gridds_giabanlemoi.Caption = "Gi\x00e1 b\x00e1n lẻ mới";
            this.gridds_giabanlemoi.ColumnEdit = this.repositoryItemTextEdit2;
            this.gridds_giabanlemoi.FieldName = "giabanlemoi";
            this.gridds_giabanlemoi.Name = "gridds_giabanlemoi";
            this.gridds_giabanlemoi.OptionsColumn.AllowEdit = false;
            this.gridds_giabanlemoi.Visible = true;
            this.gridds_giabanlemoi.VisibleIndex = 6;
            this.gridds_ngayapgia.Caption = "Ng\x00e0y \x00e1p gi\x00e1";
            this.gridds_ngayapgia.FieldName = "ngayapgia";
            this.gridds_ngayapgia.Name = "gridds_ngayapgia";
            this.gridds_ngayapgia.OptionsColumn.AllowEdit = false;
            this.gridds_ngayapgia.Visible = true;
            this.gridds_ngayapgia.VisibleIndex = 8;
            this.gridds_ngayapgia.Width = 0x62;
            this.gridds_tennhasx.Caption = "nhasx";
            this.gridds_tennhasx.FieldName = "tennhasx";
            this.gridds_tennhasx.Name = "gridds_tennhasx";
            this.gridds.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.gridds.Location = new Point(3, 0x30);
            this.gridds.MainView = this.gridView1;
            this.gridds.Name = "gridds";
            this.gridds.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemTextEdit1, this.repositoryItemTextEdit2 });
            this.gridds.Size = new Size(0x436, 0x15b);
            this.gridds.TabIndex = 15;
            this.gridds.ViewCollection.AddRange(new BaseView[] { this.gridView1 });
            this.gridds.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.btnboqua.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.btnboqua.Image = Resources.Reso.imgundo;// (Image)manager.GetObject("btnboqua.Image");
            this.btnboqua.Location = new Point(0x9d, 0x1d2);
            this.btnboqua.Name = "btnboqua";
            this.btnboqua.Size = new Size(0x57, 0x17);
            this.btnboqua.TabIndex = 13;
            this.btnboqua.Text = " &Bỏ qua [F4]";
            this.btnboqua.Click += new EventHandler(this.btnboqua_Click);
            this.txtmavach.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.txtmavach.Location = new Point(0x61, 0x192);
            this.txtmavach.Name = "txtmavach";
            this.txtmavach.Properties.ReadOnly = true;
            this.txtmavach.Size = new Size(0x6d, 20);
            this.txtmavach.TabIndex = 0;
            this.txtmavach.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.txtmavach.Validated += new EventHandler(this.txttenhoatchat_Validated);
            this.label2.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label2.Font = new Font("Tahoma", 10f);
            this.label2.Location = new Point(7, 0x193);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x57, 0x13);
            this.label2.TabIndex = 2;
            this.label2.Text = "M\x00e3 vạch:";
            this.label2.TextAlign = ContentAlignment.TopRight;
            this.label15.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label15.Font = new Font("Tahoma", 10f);
            this.label15.Location = new Point(10, 0x1ad);
            this.label15.Name = "label15";
            this.label15.Size = new Size(0x59, 0x13);
            this.label15.TabIndex = 2;
            this.label15.Text = "Gi\x00e1 b\x00e1n lẻ:";
            this.label15.TextAlign = ContentAlignment.TopRight;
            this.label16.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label16.Font = new Font("Tahoma", 10f);
            this.label16.Location = new Point(580, 0x193);
            this.label16.Name = "label16";
            this.label16.Size = new Size(0x60, 0x13);
            this.label16.TabIndex = 2;
            this.label16.Text = "Nh\x00e0 sản xuất:";
            this.label16.TextAlign = ContentAlignment.TopRight;
            this.txthangsx.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
            this.txthangsx.EditValue = "";
            this.txthangsx.Enabled = false;
            this.txthangsx.Location = new Point(0x2a2, 400);
            this.txthangsx.Name = "txthangsx";
            this.txthangsx.Size = new Size(0x193, 20);
            this.txthangsx.TabIndex = 5;
            this.txthangsx.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.label8.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label8.Font = new Font("Tahoma", 10f);
            this.label8.Location = new Point(0x2fc, 0x1ac);
            this.label8.Name = "label8";
            this.label8.Size = new Size(0x65, 0x13);
            this.label8.TabIndex = 2;
            this.label8.Text = "Ng\x00e0y \x00e1p gi\x00e1:";
            this.label8.TextAlign = ContentAlignment.TopRight;
            this.dtpngayapgia.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.dtpngayapgia.EditValue = new DateTime(0x7dd, 11, 8, 2, 0x16, 9, 0x297);
            this.dtpngayapgia.Location = new Point(0x360, 0x1ac);
            this.dtpngayapgia.Name = "dtpngayapgia";
            this.dtpngayapgia.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dtpngayapgia.Properties.DisplayFormat.FormatString = "dd/MM/yyyy HH:mm";
            this.dtpngayapgia.Properties.DisplayFormat.FormatType = FormatType.DateTime;
            this.dtpngayapgia.Properties.EditFormat.FormatString = "dd/MM/yyyy HH:mm";
            this.dtpngayapgia.Properties.EditFormat.FormatType = FormatType.DateTime;
            this.dtpngayapgia.Properties.Mask.EditMask = "dd/MM/yyyy HH:mm";
            this.dtpngayapgia.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtpngayapgia.Size = new Size(0x7a, 20);
            this.dtpngayapgia.TabIndex = 10;
            this.dtpngayapgia.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.label25.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.label25.BackColor = Color.Green;
            this.label25.Font = new Font("Tahoma", 16f);
            this.label25.ForeColor = Color.White;
            this.label25.Location = new Point(0, 0);
            this.label25.Name = "label25";
            this.label25.Size = new Size(0x43a, 0x2d);
            this.label25.TabIndex = 2;
            this.label25.Text = "THEO D\x00d5I GI\x00c1 B\x00c1N";
            this.label25.TextAlign = ContentAlignment.MiddleLeft;
            this.txtgiale.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.txtgiale.Location = new Point(0x61, 0x1ac);
            this.txtgiale.Name = "txtgiale";
            this.txtgiale.Properties.Appearance.Font = new Font("Tahoma", 10f);
            this.txtgiale.Properties.Appearance.Options.UseFont = true;
            this.txtgiale.Properties.DisplayFormat.FormatString = "n0";
            this.txtgiale.Properties.DisplayFormat.FormatType = FormatType.Numeric;
            this.txtgiale.Properties.EditFormat.FormatString = "n0";
            this.txtgiale.Properties.EditFormat.FormatType = FormatType.Numeric;
            this.txtgiale.Properties.Mask.EditMask = "n0";
            this.txtgiale.Properties.Mask.MaskType = MaskType.Numeric;
            this.txtgiale.Size = new Size(0x6d, 0x16);
            this.txtgiale.TabIndex = 6;
            this.txtgiale.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.txtgiale.Validated += new EventHandler(this.txtgiale_Validated);
            this.txtgiasi.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.txtgiasi.Location = new Point(0x120, 0x1ac);
            this.txtgiasi.Name = "txtgiasi";
            this.txtgiasi.Properties.Appearance.Font = new Font("Tahoma", 10f);
            this.txtgiasi.Properties.Appearance.Options.UseFont = true;
            this.txtgiasi.Properties.DisplayFormat.FormatString = "n0";
            this.txtgiasi.Properties.DisplayFormat.FormatType = FormatType.Numeric;
            this.txtgiasi.Properties.EditFormat.FormatString = "n0";
            this.txtgiasi.Properties.EditFormat.FormatType = FormatType.Numeric;
            this.txtgiasi.Properties.Mask.EditMask = "n2";
            this.txtgiasi.Properties.Mask.MaskType = MaskType.Numeric;
            this.txtgiasi.Size = new Size(0x5c, 0x16);
            this.txtgiasi.TabIndex = 7;
            this.txtgiasi.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.btnin.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.btnin.Image = Resources.Reso.imgprint;// (Image)manager.GetObject("btnin.Image");
            this.btnin.Location = new Point(250, 0x1d2);
            this.btnin.Name = "btnin";
            this.btnin.Size = new Size(0x3d, 0x17);
            this.btnin.TabIndex = 14;
            this.btnin.Text = " &In";
            this.btnin.Click += new EventHandler(this.btnin_Click);
            this.label1.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label1.Font = new Font("Tahoma", 10f);
            this.label1.Location = new Point(0xcb, 0x1ad);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x58, 0x13);
            this.label1.TabIndex = 2;
            this.label1.Text = "Gi\x00e1 b\x00e1n sỉ:";
            this.label1.TextAlign = ContentAlignment.TopRight;
            this.label4.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label4.Font = new Font("Tahoma", 10f);
            this.label4.Location = new Point(0x17b, 0x1ad);
            this.label4.Name = "label4";
            this.label4.Size = new Size(0x61, 0x13);
            this.label4.TabIndex = 2;
            this.label4.Text = "Gi\x00e1 b\x00e1n lẻ cũ:";
            this.label4.TextAlign = ContentAlignment.TopRight;
            this.label5.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label5.Font = new Font("Tahoma", 10f);
            this.label5.Location = new Point(580, 0x1ad);
            this.label5.Name = "label5";
            this.label5.Size = new Size(0x60, 0x13);
            this.label5.TabIndex = 2;
            this.label5.Text = "Gi\x00e1 b\x00e1n sỉ cũ:";
            this.label5.TextAlign = ContentAlignment.TopRight;
            this.txtgialecu.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.txtgialecu.Location = new Point(0x1da, 0x1ac);
            this.txtgialecu.Name = "txtgialecu";
            this.txtgialecu.Properties.Appearance.Font = new Font("Tahoma", 10f);
            this.txtgialecu.Properties.Appearance.Options.UseFont = true;
            this.txtgialecu.Properties.DisplayFormat.FormatString = "n0";
            this.txtgialecu.Properties.DisplayFormat.FormatType = FormatType.Numeric;
            this.txtgialecu.Properties.EditFormat.FormatString = "n0";
            this.txtgialecu.Properties.EditFormat.FormatType = FormatType.Numeric;
            this.txtgialecu.Properties.Mask.EditMask = "n0";
            this.txtgialecu.Properties.Mask.MaskType = MaskType.Numeric;
            this.txtgialecu.Size = new Size(0x6d, 0x16);
            this.txtgialecu.TabIndex = 8;
            this.txtgialecu.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.txtgiasicu.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.txtgiasicu.Location = new Point(0x2a2, 0x1ac);
            this.txtgiasicu.Name = "txtgiasicu";
            this.txtgiasicu.Properties.Appearance.Font = new Font("Tahoma", 10f);
            this.txtgiasicu.Properties.Appearance.Options.UseFont = true;
            this.txtgiasicu.Properties.DisplayFormat.FormatString = "n0";
            this.txtgiasicu.Properties.DisplayFormat.FormatType = FormatType.Numeric;
            this.txtgiasicu.Properties.EditFormat.FormatString = "n0";
            this.txtgiasicu.Properties.EditFormat.FormatType = FormatType.Numeric;
            this.txtgiasicu.Properties.Mask.EditMask = "n2";
            this.txtgiasicu.Properties.Mask.MaskType = MaskType.Numeric;
            this.txtgiasicu.Size = new Size(0x5c, 0x16);
            this.txtgiasicu.TabIndex = 9;
            this.txtgiasicu.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            base.AutoScaleDimensions = new SizeF(6f, 13f);
//            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.btnin);
            base.Controls.Add(this.txtgiasicu);
            base.Controls.Add(this.txtgialecu);
            base.Controls.Add(this.txtgiasi);
            base.Controls.Add(this.txtgiale);
            base.Controls.Add(this.dtpngayapgia);
            base.Controls.Add(this.txtma);
            base.Controls.Add(this.gridds);
            base.Controls.Add(this.btnketthuc);
            base.Controls.Add(this.btnboqua);
            base.Controls.Add(this.btnsua);
            base.Controls.Add(this.btnluu);
            base.Controls.Add(this.txtmavach);
            base.Controls.Add(this.txtten);
            base.Controls.Add(this.label2);
            base.Controls.Add(this.txthangsx);
            base.Controls.Add(this.label25);
            base.Controls.Add(this.label8);
            base.Controls.Add(this.label5);
            base.Controls.Add(this.label16);
            base.Controls.Add(this.label1);
            base.Controls.Add(this.label4);
            base.Controls.Add(this.lblmaso);
            base.Controls.Add(this.label15);
            base.Name = "ucd_capnhatgiaban";
            base.Size = new Size(0x439, 0x1ed);
            base.Load += new EventHandler(this.ucDMSanPham_Load);
            base.ControlRemoved += new ControlEventHandler(this.ucd_nhapkho_ControlRemoved);
            base.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.repositoryItemTextEdit2.EndInit();
            this.txtma.Properties.EndInit();
            this.txtten.Properties.EndInit();
            this.gridView1.EndInit();
            this.repositoryItemTextEdit1.EndInit();
            this.gridds.EndInit();
            this.txtmavach.Properties.EndInit();
            this.txthangsx.Properties.EndInit();
            this.dtpngayapgia.Properties.VistaTimeProperties.EndInit();
            this.dtpngayapgia.Properties.EndInit();
            this.txtgiale.Properties.EndInit();
            this.txtgiasi.Properties.EndInit();
            this.txtgialecu.Properties.EndInit();
            this.txtgiasicu.Properties.EndInit();
            base.ResumeLayout(false);
        }

        private void tbnumslsang_Validated(object sender, EventArgs e)
        {
            try
            {
            }
            catch
            {
            }
        }

        private void txtgiale_Validated(object sender, EventArgs e)
        {
            try
            {
                this.txtgiasi.EditValue = this.txtgiale.EditValue;
            }
            catch
            {
            }
        }

        private void txtma_Validated(object sender, EventArgs e)
        {
        }

        private void txtten_Enter(object sender, EventArgs e)
        {
        }

        private void txtten_KeyDown(object sender, KeyEventArgs e)
        {
            this.ucDMSanPham_KeyDown(sender, e);
        }

        private void txtten_TextChanged(object sender, EventArgs e)
        {
        }

        private void txtten_Validated(object sender, EventArgs e)
        {
            try
            {
            }
            catch
            {
            }
        }

        private void txttenhoatchat_Validated(object sender, EventArgs e)
        {
        }

        private void ucd_nhapkho_ControlRemoved(object sender, ControlEventArgs e)
        {
        }

        private void ucDMSanPham_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                SendKeys.Send("{Tab}");
            }
            else if (e.KeyCode == Keys.F3)
            {
                if (this.btnsua.Enabled)
                {
                    this.btnsua_Click(null, null);
                }
            }
            else if (e.KeyCode == Keys.F4)
            {
                if (this.btnboqua.Enabled)
                {
                    this.btnboqua_Click(null, null);
                }
            }
            else if (e.KeyCode == Keys.F5)
            {
                if (this.btnluu.Enabled)
                {
                    this.btnluu_Click(null, null);
                }
            }
            else if ((e.KeyCode == Keys.F12) && this.btnketthuc.Enabled)
            {
                this.btnketthuc_Click(null, null);
            }
        }

        private void ucDMSanPham_Load(object sender, EventArgs e)
        {
            this._nhapkho = new DNhapKho(this._xuli.pConFigData);
            this.f_load_dmkho();
            this.f_load_theodoigia();
            this.btnboqua_Click(null, null);
            this.f_loadinfo_chitiet(0);
            this.txtmavach.Focus();
        }
    }
}

